package com.team_project.boot.mapper;

import com.team_project.boot.entity.User;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Mapper
public interface UserMapper {

//    @Select("select password from cut where username=#{username}")
//    String selectUserPw(String username);
    @Select("select id,username,password,nickname,gender,birth,role from cut where username =#{username}")
    User selectUser(String username);
    @Select("select username from cut where username=#{username}")
    String selectUserName(String username);
    @Insert("insert into cut(username,password,nickname,gender,birth,role) values(#{username},#{password},#{nickname},#{gender},#{birth},#{role})")
    void insert(User user);
    @Select("select id,username,password,nickname,gender,birth,role from cut")
    List<User> selectUserAll();
    @Delete("delete from cut where id=#{id}")
    void deleteById(int id);
    @Update("update cut set username=#{username},nickname=#{nickname},role=#{role},birth=#{birth} where id=#{id}")
    void updateById(User user);
    @Select("select id,username,nickname,birth,role from cut where id =#{id}")
    User selectbyIdMember(int id);

}
